//
//  KeyboardViewController.swift
//  LovelyKeyborad-Extenxion
//
//  Created by Wade on 2025/1/12.
//

import UIKit
import KeyboardKit
class KeyboardViewController: KeyboardInputViewController {

    override func viewDidLoad() {
        self.primaryLanguage = "zh_CN"
    }
    
    
    override func viewWillSetupKeyboardView() {
        super.viewWillSetupKeyboardView()
        setupKeyboardView {controller in
            CustomUIViewRepresentable().frame(width: controller.view.bounds.size.width,height: 300)
        }
    }
    
    override func textWillChange(_ textInput: UITextInput?) {
        // The app is about to change the document's contents. Perform any preparation here.
    }
    
    override func textDidChange(_ textInput: UITextInput?) {
        // The app has just changed the document's contents, the document context has been updated.
        
        var textColor: UIColor
        let proxy = self.textDocumentProxy
        if proxy.keyboardAppearance == UIKeyboardAppearance.dark {
            textColor = UIColor.white
        } else {
            textColor = UIColor.black
        }

    }

}
